package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.log.OrderHelmetLostLogDao;
import com.tbit.uqbike.client.pojo.OrderHelmetLostLog;
import com.tbit.uqbike.client.service.OrderHelmetLostLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yao
 * @since 2025/2/28 9:36
 */
@Service
public class OrderHelmetLostLogServiceImpl implements OrderHelmetLostLogService {

    @Autowired
    private OrderHelmetLostLogDao orderHelmetLostLogDao;

    @Override
    public List<OrderHelmetLostLog> getList() {
        return orderHelmetLostLogDao.selectList();
    }

    @Override
    public OrderHelmetLostLog getById(Integer id) {
        return orderHelmetLostLogDao.getById(id);
    }

    @Override
    public void create(OrderHelmetLostLog log) {
        orderHelmetLostLogDao.insertCheckNull(log);
    }

    @Override
    public void update(OrderHelmetLostLog log) {
        orderHelmetLostLogDao.updateCheckNull(log);
    }

    @Override
    public void delete(Integer id) {
        orderHelmetLostLogDao.delete(id);
    }

    /**
     * @description: 根据订单号获取头盔丢失日志数量
     * @author: mo.shanyong
     * @date: 2025/3/26 15:45
     * @param: orderNO 订单号
     * @return: int
     */
    @Override
    public int getCountByOrderNO(String orderNO) {
        return orderHelmetLostLogDao.getCountByOrderNO(orderNO);
    }
}
